<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});

$api = app('Dingo\Api\Routing\Router');

$apiFunc=function ($api) {

    //user 端无需token
    $api->group(['namespace' => 'App\Api\Controllers\User', 'prefix' => 'user'], function ($api) {
        $api->any('login', 'LoginController@login');
        $api->any('register', 'LoginController@register');
        $api->any('edit_password', 'LoginController@edit_password');

        $api->any('sub_code_url', 'SelectController@sub_code_url');
        $api->any('s_code_url', 'SelectController@s_code_url');
        $api->any('goods_info', 'GoodsController@goods_info');
        $api->any('goods_lists', 'GoodsController@goods_lists');
        $api->any('banners', 'BannerController@banners'); //公共banner
    });




    //需要token
    $api->group(['namespace' => 'App\Api\Controllers\User', 'prefix' => 'user', 'middleware' => 'user.api'], function ($api) {
        $api->any('index', 'LoginController@index');
        $api->any('ranking', 'SelectController@ranking');
        $api->any('pingan', 'SelectController@pingan');
        $api->any('pingan_plug', 'SelectController@pingan_plug');
        $api->any('usercompany', 'SelectController@usercompany');
        $api->any('merchant_turnover', 'SelectController@merchant_turnover');
        $api->any('merchant_id_turnover', 'SelectController@merchant_id_turnover');
        $api->any('dk_select', 'SelectController@dk_select');
        $api->any('select_pid_user', 'SelectController@select_pid_user');
        $api->any('clear_ways_type', 'SelectController@clear_ways_type');
        $api->post('volume', 'SelectController@volume'); //门店交易量


        //月统计
        $api->any('Order_mouth_count', 'OrderCountController@Order_mouth_count');
        $api->any('order_month_count','OrderCountController@order_month_count');

        $api->any('merchant_lists', 'SelectController@merchant_lists');
        $api->any('rataDetail', 'SelectController@rataDetail');
        $api->any('feeDetail', 'SelectController@feeDetail');
        $api->any('mechanism_merchant_add', 'SelectController@mechanism_merchant_add');
        $api->any('couponDetail_list', 'SelectController@couponDetail_list');
        $api->any('add_merchant', 'SelectController@add_merchant');
        $api->any('bind_merchant', 'SelectController@bind_merchant');
        $api->any('up_merchant', 'SelectController@up_merchant');
        $api->any('del_merchant', 'SelectController@del_merchant');
        $api->any('merchant_info', 'SelectController@merchant_info');
        $api->any('company_all_store_list', 'SelectController@company_all_store_list'); //渠道全量商户
        $api->any('store_company_model_list', 'SelectController@store_company_model_list'); //通道模式商户列表

        $api->any('get_sub_users', 'UserController@get_sub_users');
        $api->any('get_sf_sub_users', 'UserController@get_sf_sub_users');

        $api->any('get_del_sub_users', 'UserController@get_del_sub_users');
        $api->any('add_sub_user', 'UserController@add_sub_user');
        $api->any('add_sub_user_new', 'UserController@add_sub_user_new');
        $api->any('del_sub_user', 'UserController@del_sub_user');
        $api->any('cz_user_password', 'UserController@cz_user_password');//重置代理商密码
        $api->any('server_sub_user', 'UserController@server_sub_user');
        $api->any('fog_sub_user', 'UserController@fog_sub_user');
        $api->any('cdel_sub_user', 'UserController@cdel_sub_user');

        $api->any('user_info', 'UserController@user_info');
        $api->any('my_info', 'UserController@my_info');
        $api->any('fuwushang_openid', 'UserController@fuwushang_openid');
        $api->any('smallpay', 'UserController@smallpay');
        $api->any('notify', 'UserController@notify');
        $api->any('up_user', 'UserController@up_user');
        $api->any('set_password', 'UserController@set_password');
        $api->any('edit_login_phone', 'UserController@edit_login_phone');

        $api->any('add_pay_password', 'UserController@add_pay_password');
        $api->any('edit_pay_passcommission_listsword', 'UserController@edit_pay_password');
        $api->any('forget_pay_password', 'UserController@forget_pay_password');
        $api->any('check_pay_password', 'UserController@check_pay_password');
        $api->post('check_platform_pay_password', 'UserController@check_platform_pay_password'); //验证平台支付密码
        $api->any('is_pay_password', 'UserController@is_pay_password');

        $api->any('get_my_data', 'UserController@get_my_data');
        $api->any('server_log', 'UserController@server_log');
        $api->any('store_lists', 'UserController@store_lists');
        $api->any('custom_query', 'UserController@custom_query');

        $api->any('user_ways_all', 'UserController@user_ways_all');
        $api->any('server_ways_all', 'UserController@server_ways_all');

        $api->any('user_ways_default', 'UserController@user_ways_default');

        $api->any('user_ways_info', 'UserController@user_ways_info');
        $api->any('edit_user_rate', 'UserController@edit_user_rate');
        $api->any('edit_user_yinlian_rate', 'UserController@edit_user_yinlian_rate');
        $api->any('edit_server_rate', 'UserController@edit_server_rate');
        $api->any('del_user_rate', 'UserController@del_user_rate');

        $api->any('edit_user_un_rate', 'UserController@edit_user_un_rate');
        $api->any('edit_user_unqr_rate', 'UserController@edit_user_unqr_rate');

        $api->any('edit_user_store_all_rate', 'UserController@edit_user_store_all_rate');
        $api->any('edit_user_store_yinlian_all_rate', 'UserController@edit_user_store_yinlian_all_rate');

        $api->any('edit_user_un_store_all_rate', 'UserController@edit_user_un_store_all_rate');
        $api->any('edit_user_unqr_store_all_rate', 'UserController@edit_user_unqr_store_all_rate');

        $api->any('alipay_isv_config', 'ConfigController@alipay_isv_config');
        $api->any('alipay_zft_config', 'ConfigController@alipay_zft_config');

        $api->any('weixin_config', 'ConfigController@weixin_config');
        $api->any('weixina_config', 'ConfigController@weixina_config'); //官方微信a
        $api->any('jd_config', 'ConfigController@jd_config');
        $api->any('new_land_config', 'ConfigController@new_land_config');
        $api->any('h_config', 'ConfigController@h_config');
        $api->any('mqtt_config', 'ConfigController@mqtt_config');

        $api->any('pay_ways_sort', 'SetController@pay_ways_sort');
        $api->any('pay_ways_sort_edit', 'SetController@pay_ways_sort_edit');
        $api->any('pay_ways_sort_edit_pc', 'SetController@pay_ways_sort_edit_pc');
        $api->post('pay_ways_sort_top', 'SetController@pay_ways_sort_top');
        $api->any('user_store_set_status', 'SetController@user_store_set_status');
        $api->any('pay_ways_sort_start', 'SetController@pay_ways_sort_start');
        $api->any('store_ways_set', 'SetController@store_ways_set');
        $api->any('store_ways_select', 'SetController@store_ways_select');
        $api->post('pay_ways_open', 'SetController@pay_ways_open');
        $api->post('edit_pwd', 'UserController@edit_pwd');  //更改密码
        $api->post('update_affiliation', 'UserController@update_affiliation');  //代理商转移

        //门店列表
        $api->any('store_lists', 'StoreController@store_lists');
        $api->any('store_lists_new', 'StoreController@store_lists_new');
        $api->any('store_pc_lists', 'StoreController@store_pc_lists');
        $api->any('up_store_goods', 'StoreController@up_store_goods');
        $api->any('up_store_refund', 'StoreController@up_store_refund');

        $api->any('up_store_quota', 'StoreController@up_store_quota');

        $api->any('store_all_lists', 'StoreController@store_all_lists');

        $api->any('store', 'StoreController@store');
        $api->any('up_store', 'StoreController@up_store');
        $api->any('pay_ways_all', 'StoreController@pay_ways_all');
        $api->any('update_merch_token', 'InfoController@update_merch_token');
        $api->post('pay_ways_all_new', 'StoreController@pay_ways_all_new');
        $api->any('store_all_pay_way_lists', 'StoreController@store_all_pay_way_lists');
        $api->any('store_open_pay_way_lists', 'StoreController@store_open_pay_way_lists');
        $api->any('dlb_store_info', 'StoreController@dlb_store_info'); //获取哆啦宝-进件所需相应信息
        $api->post('checkAddStoreInfo', 'StoreController@checkAddStoreInfo'); //进件参数检查

        $api->any('company_pay_ways_info', 'StoreController@company_pay_ways_info');
        $api->any('open_company_pay_ways', 'StoreController@open_company_pay_ways');
        $api->any('open_company_pay_ways1', 'StoreController@open_company_pay_ways1');

        $api->any('pay_ways_info', 'StoreController@pay_ways_info');

        $api->any('edit_store_rate', 'StoreController@edit_store_rate');
        $api->any('edit_store_un_rate', 'StoreController@edit_store_un_rate');
        $api->any('edit_store_unqr_rate', 'StoreController@edit_store_unqr_rate');
        $api->any('edit_store_rate_pc', 'StoreController@edit_store_rate_pc');
        $api->any('edit_store_yinlian_rate_pc', 'StoreController@edit_store_yinlian_rate_pc');

        $api->any('del_store', 'StoreController@del_store');
        $api->any('col_store', 'StoreController@col_store');
        $api->any('ope_store', 'StoreController@ope_store');
        $api->any('clear_store', 'StoreController@clear_store');
        $api->any('rec_store', 'StoreController@rec_store');
        $api->any('update_user', 'StoreController@update_user');

        $api->any('open_ways_type', 'StoreController@open_ways_type');
        $api->any('get_sub_merchant', 'StoreController@get_sub_merchant');
        $api->any('add_sub_store', 'StoreController@add_sub_store');
        $api->any('add_sub_store1', 'StoreController@add_sub_store1');
        $api->any('check_store', 'StoreController@check_store');
        $api->any('rata_store', 'StoreController@rata_store');
        $api->any('alipay_auth', 'StoreController@alipay_auth');

        $api->any('store_pay_qr', 'StoreController@store_pay_qr');
        $api->any('store_pay_qr1', 'StoreController@store_pay_qr1');
        $api->any('user_qrpay', 'StoreController@user_qrpay');
        $api->any('get_mer_id', 'StoreController@get_mer_id'); //汇付-获取商户号
        $api->any('hui_pay_bind', 'StoreController@hui_pay_bind'); //汇付-绑定机具

        $api->any('storeListToInstall', 'StoreController@storeListToInstall');
        $api->any('updateStoreInstallStatus', 'StoreController@updateStoreInstallStatus');

        $api->post('updateDaDaConfig', 'StoreController@updateDaDaConfig');  //达达配送设置
        $api->post('applyWeChatRealName', 'StoreController@applyWeChatRealName');  //微信实名认证申请
        $api->post('queryWeChatRealName', 'StoreController@queryWeChatRealName');  //微信实名认证结果查询
        $api->post('backWeChatRealName', 'StoreController@backWeChatRealName');  //微信实名认证撤销
        $api->post('queryGrantStatusWeChatRealName', 'StoreController@queryGrantStatusWeChatRealName');  //微信子商户授权状态查询

        $api->any('notice_news', 'InfoController@notice_news');
        $api->any('add_notice_news', 'InfoController@add_notice_news');
        $api->any('del_notice_news', 'InfoController@del_notice_news');
        $api->any('toutiao', 'InfoController@toutiao');
        $api->any('toutiao_top', 'InfoController@toutiao_top');
        $api->any('notice_news_type', 'InfoController@notice_news_type');

        $api->any('goods_list', 'GoodsController@goods_list');
        $api->any('add_goods', 'GoodsController@add_goods');
        $api->any('del_goods', 'GoodsController@del_goods');
        $api->any('goods_cate', 'GoodsController@goods_cate');
        $api->any('add_goods_cate', 'GoodsController@add_goods_cate');

        $api->any('merchant_index', 'InfoController@merchant_index');
        $api->any('add_merchant_index', 'InfoController@add_merchant_index');
        $api->any('del_merchant_index', 'InfoController@del_merchant_index');

        $api->any('my_index', 'InfoController@my_index');
        $api->any('add_my_index', 'InfoController@add_my_index');
        $api->any('del_my_index', 'InfoController@del_my_index');
        $api->any('user_tt_set', 'InfoController@user_tt_set');

//        $api->any('banners', 'BannerController@banners');
        $api->any('add_banners', 'BannerController@add_banners');
        $api->any('del_banners', 'BannerController@del_banners');
        $api->any('banner_type', 'BannerController@banner_type');

        $api->any('order', 'OrderController@order');
        $api->any('lastbill', 'OrderController@lastbill');
        $api->any('merchant_turnover_last_week', 'OrderController@merchant_turnover_last_week');
        $api->any('allinpayah_count', 'OrderController@allinpayah_count');
        $api->any('user_stores', 'OrderController@user_stores');
        $api->any('merchant_company', 'OrderController@merchant_company');
        $api->any('order_info', 'OrderController@order_info');

        $api->any('order_count', 'OrderController@order_count');
        $api->any('order_count1', 'OrderController@order_count1');
        $api->any('order_data', 'OrderController@order_data');
        $api->any('store_order_data', 'OrderController@store_order_data');
        $api->any('settle_order', 'OrderController@settle_order');
        $api->post('face_payment_statistics', 'OrderController@face_payment_statistics'); //刷脸支付统计(去重)
        $api->post('face_payment_dis', 'OrderController@face_payment_dis'); //刷脸设备统计

        //花呗分期
        $api->any('fq/order', 'AlipayFqOrderController@order');
        $api->any('fq/order_info', 'AlipayFqOrderController@order_info');

        $api->any('fq/set_fq_get_rate', 'AlipayFqOrderController@set_fq_get_rate');
        $api->any('fq/set_fq_get_list', 'AlipayFqOrderController@set_fq_get_list');
        $api->any('fq/del_fq_get_rate', 'AlipayFqOrderController@del_fq_get_rate');

        $api->post('profit_sharing_lists', 'OrderController@profit_sharing_lists'); //微信分账流水

        //空码管理
        $api->any('QrLists', 'QrController@QrLists');
        $api->any('QrListinfos', 'QrController@QrListinfos');
        $api->any('DownloadQr', 'QrController@DownloadQr');
        $api->any('createQr', 'QrController@createQr');
        $api->any('bindQr', 'QrController@bindQr');
        $api->any('unbindQr', 'QrController@unbindQr');

        $api->any('qr_code_hb_list', 'QrController@qr_code_hb_list');
        $api->any('qr_code_hb_add', 'QrController@qr_code_hb_add');
        $api->any('qr_code_hb_del', 'QrController@qr_code_hb_del');

        $api->any('activity_store_rate_list', 'ActivityController@activity_store_rate_list');
        $api->any('add_activity_store_rate', 'ActivityController@add_activity_store_rate');
        $api->any('del_activity_store_rate', 'ActivityController@del_activity_store_rate');

        $api->any('dlb_config', 'ConfigController@dlb_config');  //哆啦宝
        $api->any('hltx_config', 'ConfigController@hltx_config'); //葫芦天下
        $api->any('tf_config', 'ConfigController@tf_config');  //传化
        $api->any('vbill_config', 'ConfigController@vbill_config'); //随行付支付配置
        $api->any('vbilla_config', 'ConfigController@vbilla_config'); //随行付a支付配置
        $api->any('easypay_config', 'ConfigController@easypay_config'); //易生支付支付配置
        $api->any('update_config', 'ConfigController@update_config'); //代理升级独立配置
        $api->any('hui_pay_config', 'ConfigController@hui_pay_config'); //汇付
        $api->any('hkrt_config', 'ConfigController@hkrt_config'); //海科融通
        $api->any('linkage_config', 'ConfigController@linkage_config'); //联动优势
        $api->post('business_scope', 'StoreController@business_scope'); //营业范围
        $api->post('putVoice', 'StoreController@putVoice'); //营业范围
        $api->post('voicePayQr', 'StoreController@voicePayQr'); //营业范围
        $api->post('wftpay_config', 'ConfigController@wftpay_config'); //威富通
        $api->post('hwcpay_config', 'ConfigController@hwcpay_config'); //威富通
        $api->post('dada_config', 'ConfigController@dada_config'); //达达配置
        $api->any('dongguan_config', 'ConfigController@dongguan_config'); //东莞银行
        $api->any('user_trade_rank', 'SelectController@user_trade_rank');//渠道交易排名
        $api->any('user_store_count', 'SelectController@user_store_count');

        $api->any('goods_count', 'OrderController@goods_count');
        $api->any('arrearage_merchant', 'OrderController@arrearage_merchant');
        $api->any('agent_list', 'OrderController@agent_list');


        $api->any('company_lists', 'CompanyController@lists');
        $api->any('company_edit', 'CompanyController@edit');
        $api->any('company_merchant_lists', 'CompanyController@b_lists');
        $api->any('company_merchant_quota_config', 'CompanyController@b_quota_config');
        $api->any('company_merchant_quota_add', 'CompanyController@b_quota_add');
        $api->any('company_import_quota', 'CompanyController@import_quota');
        $api->any('company_import_list', 'CompanyController@import_list');
        $api->any('company_store_list', 'CompanyController@store_list');

        $api->any('company_import_quota_all', 'CompanyController@import_quota_all');
        $api->any('company_download_mch', 'CompanyController@download_mch');

        $api->any('easypaya_get_quota', 'CompanyController@easypayGetQuota');
        $api->any('easypaya_get_config', 'CompanyController@easypayGetConfig');
    });
};
$api->version('v1', $apiFunc);
